#pragma once
#include "CBaseEnemy.h"


class CRetroInput;
class CDirect3D;
class CObjectManager;
class CEnemySpawner : public CBaseEnemy
{
private:	
	USHORT m_lEnemiesToSpawn;
	float m_fActivateRange;
	float m_fSpawnRate;
	float m_fSpawnTimer;
	UINT m_unMaxSpawn;
	UINT m_unCurrentSpawn;
	bool m_bActivated;
	CBaseObject* m_pObjectForRange;
	CObjectManager* m_pObjMan;
public:
	CEnemySpawner(void);
	~CEnemySpawner(void);

	void Initialize();
	void Initialize(int posX, int posY, float depth, int collisionWidth, int collisionHeight, USHORT enemiesToSpawnFlags, float activateRange, float spawnRate, UINT maxSpawn, CBaseObject* pObjectForRange);
	void Input(CRetroInput* pInput);
	void Update(float fDeltaTime);
	void Render(CDirect3D* pRender, CCamera* pCamera);
	void Destroy();
	void SubtractSpawn() { --m_unCurrentSpawn;}
	bool CheckCollision(IBaseObject* pObject);
	inline ObjectType Type() { return OBJECT_ENEMY;}
	inline EnemyType EType() { return ENEMY_SPAWNER;}

};

